import request from '@/utils/request';
import { TableListQueryParams, TableListItem } from './data.d';

export async function queryList(params?: TableListQueryParams): Promise<any> {
  return request({
    url: '/admin-role/List',
    method: 'POST',
    data:params
  });
}

export async function createData(params: Omit<TableListItem, 'id'>): Promise<any> {
  return request({
    url: '/admin-role/add',
    method: 'POST',
    data: params,
  });
}

export async function updateData(params: Omit<TableListItem, 'id'>): Promise<any> {
  return request({
    url: `/admin-role/update`,
    method: 'POST',
    data: params,
  });
}

export async function removeData(id: number): Promise<any> {
  return request({
    url: '/admin-role/Delete', 
    method: 'POST',
	data: {id:id},
  });
}

export async function detailData(id: number): Promise<any> {
  return request({url: `/admin-role/list/${id}`});
}
